<template>
  <div class="app">
    我是app元素
    <BaseSon :title="myTitle" @changeTitle="changeMyTitle"></BaseSon>
  </div>
</template>

<script>
import BaseSon from "./components/BaseSon.vue";
export default {
  components: {
    BaseSon
  },
  data() {
    return {
      myTitle: "学前端，来黑马"
    };
  },
  methods: {
    changeMyTitle(newTitle) {
      console.log("app组件收到子组件发来的消息", newTitle);
      this.myTitle = newTitle;
    }
  }
};
</script>

<style>
.app {
  padding: 20px;
  border: 3px solid #000;
}
</style>